package datacollection;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class DataParsingMain{
	public static void main(String[] args){
		WebParser web = new WebParser();
		String data = "";
		for (int i = 1; i < 519; i++){
			if (true){
				String filename = "c:\\Users\\Jamison\\Documents\\PopulationInfo\\Maryland\\Maryland" + i + ".txt";
				File f = new File(filename);
				data += web.parseCensusPageData(f) + "\n";
				System.out.println(i);
			}
		}
		File toWrite = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\MarylandCensus.txt");
		try {
			FileOutputStream writer = new FileOutputStream(toWrite);
			writer.write(data.getBytes());
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
